package com.demo.client.controller;

import com.demo.common.entity.UserDemo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.demo.client.service.ServerServices;


/**
 * @author tianzhuang
 * @version 1.0
 * @date 2021/12/13 11:25
 */
@RestController
@RequestMapping("/client")
public class ClientController {

    @Autowired
    private ServerServices serverServices;

    @GetMapping("/testGet")
    public String testGetMethod() {
        return serverServices.testGetMethod("tianzhuang");
    }

    @PostMapping("/testPost")
    public UserDemo testPostMethod() {
        UserDemo userDemo = new UserDemo();
        userDemo.setAge(25);
        userDemo.setId("1");
        return serverServices.testGetMethod(userDemo);
    }
}
